#======================================================================
# PURPOSE : Understanding Loops in Python
#======================================================================

#---------------------------------------------------------------------
#                          FOR Loop
#---------------------------------------------------------------------

print("\n--------------------------------------------------------- 1 ")
a=[1,"HI",(1,2,3),[3,4],{1,2,3},{1:100,'a':200}]
for i in a:
    print(i)
    
#---------------------------------------------------------------------
#                      FOR Loop (using range)
#---------------------------------------------------------------------
print("\n--------------------------------------------------------- 2 ")
for i in range(0,12,3):    # In range, upper limit (12 here) is excluded
    print(i)

#---------------------------------------------------------------------
#                      FOR Loop (break statement)
#---------------------------------------------------------------------

print("\n--------------------------------------------------------- 3 ")
a=[2,4,2,1,5,6,7,0]
for i in a:
    if i==1:
        break;
    print(i)

#---------------------------------------------------------------------
#                      FOR Loop (continue statement)
#---------------------------------------------------------------------

print("\n--------------------------------------------------------- 4 ")
a=[2,4,2,1,5,6,7,0]
for i in a:
    if i==1:
        continue;
    print(i)
    
#---------------------------------------------------------------------
#                          WHILE Loop
#---------------------------------------------------------------------

print("\n--------------------------------------------------------- 4 ")
a=1;
while a<5:
    print(a)
    a=a+1

print("Completed Successfully ... ")


